<?php

class AdAction extends BaseAction
{
    protected $enterpriseObj;

    /**
     * ���캯��
     */
    public function __construct()
    {
        parent::__construct();

        //�Ƿ��¼
        //$this->access();

        $leftMenus = C('LEFT_MENU_ADVERTISING');
        $actionName = $this->getControllerFunction();
        $enterpriseObj = session('enterprise');
        $this->enterpriseObj = $enterpriseObj;

        $alert = parseAlert();

        $this->assign('alert', $alert);

        $this->assign('_actionName', $actionName);
        $this->assign('leftMenus', $leftMenus);
        $this->assign('enterpriseObj', $enterpriseObj);
        C('LAYOUT_NAME','layouts/advertising');
    }

    /**
     * �Ƿ��¼
     */
    protected function access()
    {

        if (!session('?enterprise')) {
            header("Location:" . $this->baseUrl . "/EnterpriseSys/Auth");
            exit;
        }
    }

}